home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 102 < prev    next >
Text File  |  1996-08-06  |  2KB  |  35 lines

  1. Newsgroups: comp.std.c
  2. Path: info.physics.utoronto.ca!utzoo!spenford!henry
  3. From: Henry Spencer <henry@zoo.toronto.edu>
  4. Subject: Re: Meaning of __STDC__?
  5. References: <4d6673$8to@mailgate.bridgewater.ne.hcc.com>
  6. Sender: henry%spenford@zoo.toronto.edu (Henry Spencer)
  7. Organization: SP Systems, Toronto
  8. Date: Sat, 13 Jan 1996 22:08:18 GMT
  9. Message-ID: <DL545u.MBy%spenford@zoo.toronto.edu>
  10.  
  11. In article <4d6673$8to@mailgate.bridgewater.ne.hcc.com> kennedy1@bwmail1.hcc.com (John W Kennedy) writes:
  12. >Is there an official statement as to what __STDC__ means?  Does it mean "This
  13. >compiler (in its current operating mode) fully supports ANSI Standard C," or
  14. >does it mean "This compiler (in its current operating mode) disallows all
  15. >extensions to ANSI Standard C."?  In my opinion, common practice and the
  16. >Rationale both support the former, rather than the latter, but is
  17. >there an official ruling?
  18.  
  19. There can be no official ruling on behavior that is outside the standard,
  20. such as extensions which do not contravene any of the standard's rules.
  21. ANSI C does not preclude extensions, it only requires that they be invoked
  22. by some mechanism whose semantics are left undefined (or implementation-
  23. defined) by the standard, such as the use of a non-standard #include <>
  24. header-file name. 
  25.  
  26. Actually, the standard says that __STDC__ is 1 in ANSI C.  It (necessarily)
  27. says nothing about what __STDC__ might or might not be in non-standard C.
  28. So technically you can't draw any conclusions at all from the presence of
  29. __STDC__; the valid conclusion is `standard -> __STDC__', not vice-versa.
  30. Of course, one would hope that most implementors have the sense to define
  31. __STDC__ only when the standard is satisfied, but counterexamples do exist.
  32. -- 
  33. The Earth is our mother.                           |       Henry Spencer
  34. Our nine months are up...                          |   henry@zoo.toronto.edu
  35.